package logic

import (
	"core/command"
	"time"
)

func (player *Player) regMsgHandler() {
	player.router.Register(uint16(command.Command_CSStartPvp_Pvp), player.startPvpHandler)
	player.router.Register(uint16(command.Command_CSOutOfCards_Pvp), player.outOfCardsHandler)
	player.router.Register(uint16(command.Command_CSCancelPvp_Pvp), player.cancelHandler)
	player.router.Register(uint16(command.Command_CSSetNickName_Online), player.setNickNameHandler)
	player.router.Register(uint16(command.Command_CSRandNickName_Online), player.randNickNameHandler)
	player.router.Register(uint16(command.Command_CSChatMsg_Online), player.chatMsgHandler)
}

func (player *Player) registerPlayerTimer() {
	player.timer.RegTimer(player.saveMongoDBTimer, 10*time.Second)
}

func (player *Player) regInnerServerHandler() {
	player.innerServerHandler[command.InnerServerCommand__n] = player.dd
}
